<template>
    <div class="set-message">
        <!-- tab按钮 -->
        <ul class="prize-type-tab clear-both">
            <li v-for="(item, index) in prizeTypeTab"
                @click="choosePrizeTypeTab(item.index)"
                :class="{'active':currentPrizeTabIndex==item.index}">{{item.name}}</li>
        </ul>
        <router-view></router-view>
    </div>
</template>

<script>
	import * as api from './../../api/api';
export default {
    data(){
        return {
             prizeTypeTab: [{
                 name:'推送设置',
                 index:0
             },{
                 name:'微信设置',
                 index:1
             }], 
            //  prizeTypeTab: [{
            //      name:'应用设置',
            //      index:0
            //  },{
            //      name:'对接设置',
            //      index:1
            //  },{
            //      name:'推送设置',
            //      index:2
            //  },{
            //      name:'微信设置',
            //      index:3
            //  }], 
            currentPrizeTabIndex:0
        }
    },
    watch:{
        currentPrizeTabIndex(a,b){
            // if(a==3){
            //     this.$router.push({name:'wxSet'})
            // }else if(a==2){
            //     this.$router.push({name:'configSet'});
            // }else if(a==1){
            //     this.$router.push({name:'apiConfigSet'});
            // }else if(a==0){
            //      this.$router.push({name:'application'});
            // }
            if(a==1){
                this.$router.push({name:'wxSet'})
            }else if(a==0){
                this.$router.push({name:'configSet'});
            }
        }
    },
    mounted(){
        this.currentPrizeTabIndex = '0'; 
    },
    computed: {

    },
    methods: {
        //切换tabs
        choosePrizeTypeTab(index){
            this.currentPrizeTabIndex = index; 
        },
    }
    
}
</script>

<style lang="less" scoped>
.set-message{
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    padding:20px 40px;
    box-sizing:border-box;
}
.prize-type-tab{
    width:100%;
    background:#F4F8FB;    
}
.prize-type-tab li{
    width: 140px;
    height: 48px;
    float: left;
    line-height: 48px;
    text-align: center;
    color:#888888;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    position: relative;
    z-index: 2;
    bottom:-1px;

}
.prize-type-tab li:not(.active){
    cursor: pointer;
}
.prize-type-tab .active{
    color: #fb6e52;
    background: #ffffff;
    border-color: #efefef;
}
.prize-type-tab li i{
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    -webkit-background-size: 120px 560px;
    background-size: 120px 560px;
    position: relative;
    top:-2px;
}
.prize-type-tab li:nth-child(1) i{
    width: 22px;
    height: 19px;
    background-position: 0 0;
}
.prize-type-tab li:nth-child(1).active i{
    background-position: -40px 0;
}
.prize-type-tab li:nth-child(2) i{
    width: 19px;
    height: 22px;
    background-position: 0 -30px;
}
.prize-type-tab li:nth-child(2).active i{
    background-position: -40px -30px;
}
.prize-type-tab li:nth-child(3) i{
    width: 19px;
    height: 21px;
    background-position: 0 -90px;
}
.prize-type-tab li:nth-child(3).active i{
    background-position: -40px -90px;
}
</style>
